home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / devel / tcl / itcl1_31.z / itcl1_31 / tcldev / itcl-1.3 / configure.in < prev    next >
Encoding:
Text File  |  1993-10-15  |  5.9 KB  |  195 lines

  1. dnl    This file is an input file used by the GNU "autoconf" program to
  2. dnl    generate the file "configure", which is run during installation
  3. dnl    to configure the system for the local environment.
  4.  
  5. AC_INIT(src/itcl_core.c)
  6.  
  7. AC_PROG_INSTALL
  8. AC_PROG_RANLIB
  9. AC_PROG_CPP
  10.  
  11. CC=${CC-cc}
  12. AC_SUBST(CC)
  13.  
  14. #--------------------------------------------------------------------
  15. #    Check for various typedefs and provide substitutes if
  16. #    they don't exist.
  17. #--------------------------------------------------------------------
  18.  
  19. AC_MODE_T
  20. AC_PID_T
  21. AC_SIZE_T
  22. AC_UID_T
  23.  
  24. #--------------------------------------------------------------------
  25. #    Locate the X11 header files and the X11 library archive.  Try
  26. #    the ac_find_x macro first, but if it doesn't find the X stuff
  27. #    (e.g. because there's no xmkmf program) then check through
  28. #    a list of possible directories.
  29. #--------------------------------------------------------------------
  30.  
  31. AC_PROGRAM_CHECK(tk_ok, xmkmf, 1, 0)
  32. if test $tk_ok = 1; then
  33.     AC_FIND_X
  34. fi
  35. if test "$x_includes" = /usr/include; then
  36.     XINCLUDES="# no special path needed"
  37. elif test "$x_includes" != ""; then
  38.     XINCLUDES=" -I$x_includes"
  39. else
  40.     echo checking for X11 header files
  41.     XINCLUDES="# no special path needed"
  42.     AC_TEST_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="nope")
  43.     if test "$XINCLUDES" = nope; then
  44.         dirs=${XINCLUDE_DIR-"/usr/unsupported/include /usr/local/include /usr/X386/include /usr/include/X11R4 /usr/X11R5/include /usr/include/X11R5 /usr/openwin/include /usr/X11/include"}
  45.         for i in $dirs ; do
  46.         if test -r $i/X11/Intrinsic.h; then
  47.             XINCLUDES=" -I$i"
  48.         fi
  49.         done
  50.     fi
  51. fi
  52. if test "$XINCLUDES" = nope; then
  53.   echo "Warning:  couldn't find any X11 include files."
  54.   XINCLUDES="# no include files found"
  55. fi
  56. AC_SUBST(XINCLUDES)
  57.  
  58. if test "$x_libraries" = /usr/lib; then
  59.     XLIBSW=-lX11
  60. elif test "$x_libraries" != ""; then
  61.     XLIBSW="-L$x_libraries -lX11"
  62. else
  63.     echo "checking for X11 library archive"
  64.     AC_HAVE_LIBRARY(X11, XLIBSW="-lX11", XLIBSW=nope)
  65.     if test "$XLIBSW" = nope; then
  66.     dirs=${XLIBRARY_DIR-"/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/lib/X11R4 /usr/X11R5/lib /usr/lib/X11R5 /usr/openwin/lib /usr/X11/lib"}
  67.     for i in $dirs ; do
  68.         if test -r $i/libX11.a; then
  69.         XLIBSW="-L$i -lX11"
  70.         fi
  71.     done
  72.     fi
  73. fi
  74. if test "$XLIBSW" = nope ; then
  75.     AC_HAVE_LIBRARY(Xwindow, XLIBSW=-lXwindow)
  76. fi
  77. if test "$XLIBSW" = nope ; then
  78.     echo "Warning:  couldn't find the X11 library archive.  Using -lX11."
  79.     XLIBSW=-lX11
  80. fi
  81. AC_SUBST(XLIBSW)
  82.  
  83. #--------------------------------------------------------------------
  84. #    Check for the existence of various libraries.  The order here
  85. #    is important, so that then end up in the right order in the
  86. #    command line generated by Make.
  87. #--------------------------------------------------------------------
  88. AC_HAVE_LIBRARY(m, [LIBS="$LIBS -lm"])
  89.  
  90. #--------------------------------------------------------------------
  91. # Make some guesses where the Tcl/Tk include files and libraries are.
  92. #--------------------------------------------------------------------
  93. PWD=`pwd`
  94.  
  95. AC_HEADER_CHECK(tcl.h,, [
  96. if test -f $PWD/../../../tcl/tcl-7.0/tclInt.h ; then
  97.   TCL_INCDIR=$PWD/../../../tcl/tcl-7.0
  98. elif test -f $PWD/../tcl7.0/tclInt.h ; then
  99.   TCL_INCDIR=$PWD/../tcl7.0
  100. elif test -f $PWD/../tcl7.0b3/tclInt.h ; then
  101.   TCL_INCDIR=$PWD/../tcl7.0b3
  102. elif test -f $x_includes/tk/tclInt.h ; then
  103.   TCL_INCDIR=$x_includes/tk
  104. elif test -f /usr/local/include/tclInt.h ; then
  105.   TCL_INCDIR=/usr/local/include
  106. else
  107.   echo "What directory contains Tcl source code (absolute path) ?"
  108.   read TCL_INCDIR
  109. fi
  110. echo "setting TCL_INCDIR as $TCL_INCDIR"
  111. AC_SUBST(TCL_INCDIR)
  112. ])
  113.  
  114. TCL_LIBDIR=unknown
  115. if test -f $PWD/../../../tcl/tcl7.0/libtcl.a ; then
  116.   TCL_LIBDIR=$PWD/../../../tcl/tcl7.0
  117. elif test -f $PWD/../tcl7.0/libtcl.a ; then
  118.   TCL_LIBDIR=$PWD/../tcl7.0
  119. elif test -f $PWD/../tcl7.0b3/libtcl.a ; then
  120.   TCL_LIBDIR=$PWD/../tcl7.0b3
  121. elif test -f $x_libraries/libtcl.a ; then
  122.   TCL_LIBDIR=$x_libraries
  123. elif test -f /usr/local/lib/libtcl.a ; then
  124.   TCL_LIBDIR=/usr/local/lib
  125. else
  126.   echo "What directory contains libtcl.a ?"
  127.   read TCL_LIBDIR
  128. fi
  129. echo "setting TCL_LIBDIR as $TCL_LIBDIR"
  130. AC_SUBST(TCL_LIBDIR) 
  131.  
  132. AC_HEADER_CHECK(tk.h,, [
  133. if test -f $PWD/../../../tk/tk-3.3/tk.h ; then
  134.   TK_INCDIR=$PWD/../../../tk/tk-3.3
  135. elif test -f $PWD/../tk3.3/tk.h ; then
  136.   TK_INCDIR=$PWD/../tk3.3
  137. elif test -f $PWD/../tk3.3b3/tk.h ; then
  138.   TK_INCDIR=$PWD/../tk3.3b3
  139. elif test -f $x_includes/tk/tk.h ; then
  140.   TK_INCDIR=$x_includes/tk
  141. elif test -f /usr/local/include/tk.h ; then
  142.   TK_INCDIR=/usr/local/include
  143. else
  144.   echo "What directory contains tk.h (absolute path) ?"
  145.   read TK_INCDIR
  146. fi
  147. echo "setting TK_INCDIR as $TK_INCDIR"
  148. AC_SUBST(TK_INCDIR)
  149. ])
  150.  
  151. TK_LIBDIR=unknown
  152. if test -f $PWD/../../../tk/tk3.3/libtk.a ; then
  153.   TK_LIBDIR=$PWD/../../../tk/tk3.3
  154. elif test -f $PWD/../tk3.3/libtk.a ; then
  155.   TK_LIBDIR=$PWD/../tk3.3
  156. elif test -f $PWD/../tk3.3b3/libtk.a ; then
  157.   TK_LIBDIR=$PWD/../tk3.3b3
  158. elif test -f $x_libraries/libtk.a ; then
  159.   TK_LIBDIR=$x_libraries
  160. elif test -f /usr/local/lib/libtk.a ; then
  161.   TK_LIBDIR=/usr/local/lib
  162. else
  163.   echo "What directory contains libtk.a ?"
  164.   read TK_LIBDIR
  165. fi
  166. echo "setting TK_LIBDIR as $TK_LIBDIR"
  167. AC_SUBST(TK_LIBDIR) 
  168.  
  169. #--------------------------------------------------------------------
  170. # Check to see if compiler will handle "-pic" for shared libraries
  171. #--------------------------------------------------------------------
  172. CFLAGS_save=$CFLAGS
  173. CFLAGS="$CFLAGS -pic"
  174. AC_COMPILE_CHECK("shared library support", , [
  175.     int i; double d;
  176.     for (i=0; i<10; i++) d=2*i;
  177. ], can_do_shared_libs=1, can_do_shared_libs=0)
  178. CFLAGS=$CFLAGS_save
  179.  
  180. if eval "ld -assert pure-text >/dev/null 2>&1"; then
  181.     can_do_shared_libs=$can_do_shared_libs
  182. else
  183.     can_do_shared_libs=0
  184. fi
  185.  
  186. if test $can_do_shared_libs = 1; then
  187.     SHARED='libitcl.so.$(VERSION)'
  188. else
  189.     SHARED=''
  190.     echo "== DON'T KNOW HOW TO DO SHARED LIBRARIES ON THIS MACHINE =="
  191. fi
  192. AC_SUBST(SHARED) 
  193.  
  194. AC_OUTPUT(Makefile src/Makefile man/Makefile)
  195.